﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Ue.CQRS.Snapshots
{
    public interface ISnapshotProvider
    {
        /// <summary>
        /// 创建快照
        /// </summary>
        /// <typeparam name="T"></typeparam>
        /// <param name="data"></param>
        /// <returns></returns>
        Snapshot Build<T>(T data);

        /// <summary>
        /// 恢复快照
        /// </summary>
        /// <typeparam name="T"></typeparam>
        /// <param name="snapshot"></param>
        /// <returns></returns>
        T Restore<T>(Snapshot snapshot);
    }
}
